<?php
  namespace Admin\Controller;

  use   \Think\Controller;

  class StuController extends Controller
  {  
  	
     public function jump(){

      


      $this->success('success',U('User/index'),2);
     }




      public function doAjax()
      {
        if(!IS_AJAX){
          $this->error('你迷路了么？呵呵');
          
        }


        $data=M('user')->select();
        $this->ajaxReturn($data);
         
      }


 

   




      public function getUrl(){
      	echo U('index').'<br>';
      	echo U('User/index').'<br>';
      	echo U('User/index').'<br>';
      }




    public function add(){
    	echo 'Admin stu Add';
    }

public function _before_add(){
	echo 'add before <br>';
}


public function _after_add(){
	echo 'add after <br>';
}


  	public function action(){
  		// $app=new UserController();
  		// $app->index();
  	// $app=A('user');
  	// $app->index();

R('User\add');
  	}
   










     public function test()
     {

     	$stu=M('lover');
     	$data=$stu->getField('name');
     	// dump($data);
     	// $data=$stu->where('id<4')->getField('name',true);
      	// $data=$stu->where('id<4')->getField('name,sex');
//gengxin
 $stu->where('id=1')->setField('name','DDS');
     	echo $stu->getLastSql().'<br>';
 
      // M('score')->where('id=1')->setInc('score');

   M('score')->where('id=2')->setInc('score',9);


 	echo M('score')->getLastSql().'<br>';
     	//shanchuduoge
    echo M('user')->fetchSql(true)->where('id>30')->delete();


     	dump($data);

     }

public function index()
{
	// echo '我是正式工';
	$app=A('user','Event');
	$app->index();

}

  }